package com.zc.framework.web.tablib.bean;

import javax.servlet.jsp.tagext.TagData;
import javax.servlet.jsp.tagext.TagExtraInfo;
import javax.servlet.jsp.tagext.VariableInfo;

/**
 * Created by zc on 2016/11/30.
 */
public class DefineTei extends TagExtraInfo {

    public DefineTei() {
    }

    public VariableInfo[] getVariableInfo(TagData data) {
        String type = (String)data.getAttribute("type");
        Object name = data.getAttribute("name");
        Object value = data.getAttribute("value");
        if(type == null) {
            if(value == null && name != null) {
                type = "java.lang.Object";
            } else {
                type = "java.lang.String";
            }
        }

        return new VariableInfo[]{new VariableInfo(data.getAttributeString("id"), type, true, VariableInfo.AT_END)};
    }

}
